{*include file="template/admin_head.htm"*}
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="containtable" class="{*$cf_controller*}">
    <tr>
	<td valign="top" bgcolor="#FFFFFF">
	    <div class="wrapper  pr_8">
		{*if $cf_action=='add' || $cf_action=='edit'*}
	
		<script type="text/javascript">
		    $(function(){
				
				$("#brand").change(function(){
					var bid = $(this).val();
					my_iframe('{*$cf_module_path*}theme-act_goods.htm?id='+bid,'选择商品',400,400);
										
						
				});			
				
				
				$("#act_form").submit(function(){
					if($("#theme_name").val()==''){
						my_alert('请输入标题','Error',"$('#theme_name').focus()");
						return false;
					}							   
				});

				call_uploader('#gt_image_button','#gt_image','nofix',{'show':'#gt_image_show'});
				{*if $row['gt_image']*}
				$("#gt_image_show").append(show_photo_div("#gt_image_button","#gt_image","{*$row['gt_image']*}","admin",false));
				{*/if*}
		    })
		</script>
		<div class="content_table_center_style">
		<div class="p8">
		    <form action="{*$form_action*}" method="post" enctype="multipart/form-data" name="act_form" id="act_form">
			<input id="sessionid" type="hidden" value="{*$cf_sessionid*}" />
			<input name="id" id="id" type="hidden" value="{*$row['theme_id']*}" />
			<input name="act" id="act" type="hidden" value="{*$cf_action*}" />
			<input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />		
		  <div class="content_panel_title">
			    <div class="contentpanelleft"></div>
			    <div class="contentpanelcenter">
				<span class="contentpanelcenter_font">新增/修改主题</span>
				<span><a class="edit at" href="{*$cf_self_page*}?dpt={*$cf_dpt*}">主题管理</a></span>
			    </div>
			    <div class="contentpanelrihgt"></div>
			</div>
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tbl tbl_nbr">
			    <tbody>
				<tr>
				    <td width="15%" align="right" ><span class="red">*</span>主题名称:</td>
				    <td width="85%" align="left"><input name="gt_title" type="text" id="gt_title" value="{*$row['gt_title']*}" size="60" maxlength="150" /></td>
				</tr>
                <tr>
				    <td width="15%" align="right" ><span class="red">*</span>简要描述:</td>
				    <td width="85%" align="left"><textarea name="gt_description" id="gt_description" rows="5" cols="80" >{*$row['gt_description']*}</textarea></td>
				</tr>
				<tr>
				    <td width="15%" align="right" ><span class="red">*</span>优惠信息:</td>
				    <td width="85%" align="left"><input name="gt_coupon" type="text" id="gt_coupon" value="{*$row['gt_coupon']*}" size="60" maxlength="150" /></td>
				</tr>
				<tr>
				    <td width="15%" align="right" ><span class="red">*</span>起购价格:</td>
				    <td width="85%" align="left"><input name="gt_price" type="text" id="gt_price" value="{*$row['gt_price']*}" size="8" maxlength="8" /></td>
				</tr>
				<tr>
				    <td width="15%" align="right" ><span class="red">*</span>封面图:</td>
				    <td width="85%" align="left"><span id='gt_image_show'><img style="cursor:pointer" id="gt_image_button" src="/public/images/admin/upload.jpg" /></span>
							<input type="hidden" name="gt_image" id="gt_image" value="{*$row['gt_image']*}" />
					</td>
				</tr>
				<tr>
				    <td width="15%" align="right" ><span class="red">*</span>是否显示:</td>
				    <td width="85%" align="left">{*html_radios name=gt_is_show options=$cf_info_var_common['yesno'] checked=$row['gt_is_show']|default:'0'*}</td>
				</tr>
                <tr>
				    <td width="15%" align="right" ><span class="red">*</span>品牌:</td>
				    <td width="85%" align="left">{*html_options name=brand id=brand options=$cf_brand selected=''*}<span class="red">#请选择品牌再进行挑选商品</span></td>
				</tr>				             
				<tr>
				    <td align="right"><span class="red">*</span>商品列表:</td>
				    <td align="left">
                    	<table width="100%" class="tbl tbl_nbr" id="goods_list">
                        {*foreach $row['goods_list'] as $v*}
                        	<tr>
                              <td>
                                  <input name="goods_id[]" type="checkbox" value="{*$v['goods_id']*}" checked="checked">
                                  <label style="font-weight:bold;">{*$v['goods_name']*}</label>
                              </td>
                            </tr>
                        {*/foreach*} 
                            
                        </table>
                    
                    
                    </td>
				</tr>				
				<tr>
				    <td colspan="2" align="center"><input type="submit" name="Submit" class="myinput" value="提 交" />
					&nbsp;&nbsp;
					<input type="button" name="back" class="myinput" value="返 回" onclick="window.history.back()" /></td>
				</tr>
			    </tbody>
			</table>
		    </form>
		</div>
		</div>
		{*else*}	

		<div class="pannel">
		    <div class="pl"></div>
		    <div class="pr"></div>
		    <div class="pc1">
			<form name="search_form" id="search_form" method="post" action="{*$cf_self_page*}">
			    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
			    <div class="pt">主题标题:
				  <input type="text" class="tet" name="skey" id="skey" size="20" value="{*$skey*}"/>
				  &nbsp;
				<!--分类:{*html_options name=stype id=stype options=$cf_info_var_common.news_sort selected=$stype*}-->
				<input type="image" src="public/images/admin/icon_search_btn.gif" /></div>		
			</form>
		    </div>

		</div>



		<div class="content_panel_title">
                    <div class="contentpanelleft"></div>
                    <div class="contentpanelcenter">
                        <span class="contentpanelcenter_font">主题管理</span>

              <span><a class="edit at" href="{*$cf_self_path*}-act_add.htm?dpt={*$cf_dpt*}">添加主题</a></span></div>
                    <div class="contentpanelrihgt"></div>
                </div>             
                <div class="content_table_center_style">
                    <div class="p8">
			<form name="list_form" id="list_form" method="post" action="{*$cf_self_page*}">
			    <input name="act" type="hidden" value="all" />
			    <input name="dpt" id="dpt" type="hidden" value="{*$cf_dpt*}" />
			    <table width="100%" class="tbl tbl_nbr">
				<thead>
				    <tr class="thd">
					<td width="6%" align="center" class="thr">ID</td>
					<td width="15%" align="center" class="thr">主题名称</td>
					<td width="16%" align="center" class="thr">封面图</td>
					<td width="15%" align="center" class="thr">是否显示</td>
					<td width="23%" align="center" class="thr">创建时间</td>
					<td colspan="2" align="center" class="thr">操作</td>
				    </tr>
				</thead>
				<tbody>
				    {*foreach $data as $item*}
				   
				    <tr onmouseover="this.style.backgroundColor='#ffC'" onmouseout="this.style.backgroundColor='#ffF'">
					<td align="center">{*$item['gt_id']*}</td>
					<td align="center">{*$item['gt_title']*}<!--<a href="default/newsinfo-id_{*$item['news_id']*}.htm" target="_blank" title="{*$item['news_title']*}">{*$item['news_title']|truncate:60*}</a>--></td>
					<td align="center"><a href="{*$item['gt_image']*}" target="_blank" ><img src="{*$item['gt_image']*}" height="50px" /></a></td>
					<td align="center">{*$cf_info_var_common['yesno'][$item['gt_is_show']]*}</td>
					<td align="center">{*$item['gt_create_time']*}</td>
					<td width="10%" align="center"><a href="{*$cf_self_path*}-act_edit_id_{*$item['gt_id']*}.htm?dpt={*$cf_dpt*}" class="edit">修改</a></td>
					<td width="15%" align="center"><!--<a href="{*$cf_self_path*}-act_del_id_{*$item['news_id']*}.htm?dpt={*$cf_dpt*}" class="del" onclick="return confirm('你确定要删除吗?')">删除</a>--></td>
				    </tr>
				    {*/foreach*}

				    <tr class="tft">
					<td colspan="7" style="padding:0;">
					    <table width="100%" border="0">
						<tr>
						    <td width="6%" align="center" style="border:0;padding:0;">&nbsp;</td>
						    <td width="22%" align="center" style="border:0;padding:0;">&nbsp;</td>
						    <td width="72%" style="border:0;padding:0;" ><div class="turnPage"><p>{*$page*}</p></div></td>
						</tr>
					    </table>
					</td>
				    </tr>
				</table>
			</form>
		    </div>
                </div>
		<div class="content_main_bottom">
                    <div class="content_main_bottom_left"></div>
                    <div class="content_main_bottom_right"></div>
                </div>
            </div>
            <br />
            {*/if*}

	    </div>
	</td>
	</tr>
</table>
{*include file="template/admin_foot.htm"*}